package com.mdms.logger;

import java.io.File;
import java.io.Serializable;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.xml.DOMConfigurator;

public class Log4j implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public Log4j(){
		
	}
	
	public static void init(String confPath) throws Exception{
		try{
		File file = new File(confPath);
        if(!file.exists()){
        	System.out.println("It is not possible to load the given log4j properties file :"+file.getAbsolutePath());
        }else{
        	 DOMConfigurator.configure(file.getAbsolutePath());
        	System.out.println("Log4j initalize succesfully");
        }
		}catch(Exception e){
			System.out.println("Log4j initalize failure");
		}
		
		
	}
}
